home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriter--custom dialogs / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1995-06-20  |  6.4 KB  |  250 lines  |  [TEXT/MPS ]

  1. /*
  2.     ChooserSupport.r -    other resources needed in order for driver to work
  3.                         with the Chooser.
  4.     
  5.     Copyright © 1992-1994 Apple Computer, Inc.
  6.     All rights reserved.
  7.  
  8.     12/20/93        dmh                Sync'd with the shipping 1.0b3 GX driver.
  9.     12/22/93        dmh                Added custom dialog code.
  10. */
  11.  
  12. #include "Types.r"
  13. #include "SysTypes.r"
  14. #include "PrintingResTypes.r"
  15.  
  16. //--------------------------------------------------------------------------------------------
  17. // THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  18. //--------------------------------------------------------------------------------------------
  19.  
  20. // what type of communication does this device use (this is the default, as the actual
  21. // value can be found in the desktop printer).
  22. resource 'look' (-4096, sysheap, purgeable) {
  23.     2,                // use the second in our list by default
  24.     
  25.     {
  26.     "AppleTalk",    -4096,        isAppleTalk,                "ImageWriter";
  27.     "Serial",        -4095,        iconCells,                    "Modem Port";
  28.     "Servers",        -4094,        isAppleTalk+isPrinterShare,    "ImageWriterIIIS";
  29.     };
  30. };
  31.  
  32.  
  33. resource 'comm' (-4096, sysheap, purgeable) {
  34.     PAP
  35.         {
  36.         1,
  37.         "",
  38.         0, 0, 0, 0
  39.         };
  40. };
  41.  
  42. resource 'comm' (-4095, sysheap, purgeable) {
  43.     Serial
  44.         {
  45.         baud9600,        /* Output baud rate */
  46.         noParity,        /* Output parity */
  47.         oneStop,        /* Output stop bits */
  48.         data8,            /* Output data size */
  49.         0xFFFF1113,        /* Output handshaking */
  50.         0x00000000,
  51.         baud9600,        /* Input baud rate */
  52.         noParity,        /* Input parity */
  53.         oneStop,        /* Input stop bits */
  54.         data8,            /* Input data bits */
  55.         0xFFFF1113,        /* Input handshaking */
  56.         0x00000000,
  57.         1024,            /* Input buffer size */
  58.         ".AIn",            /* Input driver name */
  59.         ".AOut"            /* Output driver name */
  60.         };
  61. };
  62.  
  63. resource 'comm' (-4094, sysheap, purgeable) {
  64.     PrinterShare
  65.         {
  66.         "",
  67.         0
  68.         };
  69. };
  70.  
  71.     
  72.  
  73. //--------------------------------------------------------------------------------------------
  74. // STANDARD CHOOSER PACK STUFF
  75. //--------------------------------------------------------------------------------------------
  76.  
  77. // NBP Lookup type (maxed out so resource file won't need updating)
  78. resource 'STR ' (-4096, sysheap, purgeable)
  79. {
  80.     "XXXXXXXXXXXXXXXXXXXXXX";
  81. };
  82.  
  83. // NBP timeout value
  84. type 'GNRL'
  85. {
  86.     byte;    // timeout
  87.     byte;    // retries
  88. };
  89.  
  90. resource 'GNRL' (-4096, sysheap, purgeable)
  91. {
  92.     11,
  93.     5
  94. };
  95.  
  96. // title string (we'll put a control here, so we don't want a title)
  97. resource 'STR ' (-4091, sysheap, purgeable)
  98. {
  99.     "";
  100. };
  101.  
  102. // "left" button title
  103. resource 'STR ' (-4093, sysheap, purgeable)
  104. {
  105.     "Create";
  106. };
  107.  
  108. // rectangle list
  109. resource 'nrct' (-4096, sysheap, purgeable) {
  110.     {
  111.     {112, 251, 132, 311};            // left button
  112.     {0,0,0,0};                        // right button
  113.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  114.     {0,0,0,0};                        // off button
  115.     {0,0,0,0};                        // button label
  116.     };
  117. };
  118.  
  119. // Menu used to select between direct connect, AppleTalk, and Servers
  120. resource 'MENU' (-4096, sysheap, purgeable)
  121. {
  122.     -4096,
  123.     textMenuProc,
  124.     0xFFFFFFFF,    
  125.     enabled,
  126.     "",
  127.     {
  128.     }
  129. };
  130.  
  131. // Pop-up control used to select between direct connect printers and those being shared on the network
  132. resource 'CNTL' (-4096, sysheap, purgeable)
  133. {
  134.     {0, 0, 20, 213},                            // zero based control location
  135.     0,                                            // Title options 0 = Left justified
  136.     visible,                                    // Should we display the control?
  137.     95,                                            // Title Width
  138.     -4096,                                        // 'MENU' to display
  139.     popupMenuCDEFproc+popupFixedWidth,            // CDEF = CDEFID * 16 + varCode
  140.     0,                                             // refCon = ResType to append = None
  141.     "Connect via:"                                // Control title
  142. };
  143.  
  144. resource 'DITL' (-4096, sysheap, purgeable) 
  145. {
  146.     {
  147.         {3, 238, 23, 238 + 213}, 
  148.             Control {enabled, -4096},
  149.     };
  150. };
  151.  
  152. resource 'DITL' (-4095, sysheap, purgeable) {
  153.     {    /* array DITLarray: 2 elements */
  154.         /* [1] */
  155.         {143, 310, 163, 368},
  156.         Button {
  157.             enabled,
  158.             "OK"
  159.         },
  160.         /* [2] */
  161.         {23, 87, 119, 377},
  162.         StaticText {
  163.             disabled,
  164.             "This printer driver could not be used.\n\n"
  165.             "Quitting one or more applications and then "
  166.             "trying again may allow you to use this "
  167.             "printer driver."
  168.         }
  169.     }
  170. };
  171.  
  172. resource 'ALRT' (-4095, sysheap, purgeable) {
  173.     {30, 30, 30+175, 30+380},
  174.     -4095,
  175.     {    /* array: 4 elements */
  176.         /* [1] */
  177.         OK, visible, sound1,
  178.         /* [2] */
  179.         OK, visible, sound1,
  180.         /* [3] */
  181.         OK, visible, sound1,
  182.         /* [4] */
  183.         OK, visible, sound1
  184.     },
  185.     alertPositionParentWindowScreen
  186. };
  187.  
  188. //-----------------------------------------------------------------------------------
  189. // CHOOSER PACK HELP RESOURCES
  190. //-----------------------------------------------------------------------------------
  191.  
  192.  
  193. /*    Any Chooser package can get balloons on all items that are normally 
  194.     added to the Chooser dialog by containing a STR# resource of 
  195.     resource ID = PackResID (-5694) and following the convention below:
  196.         
  197.         resource 'STR#' (-5694, sysheap, purgeable) {
  198.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  199.                 "kDisabledLeftButton";    // message for the control that is Disabled
  200.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  201.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  202.                 "kEnabledRightButton";
  203.                 "kDisabledRightButton";
  204.                 "kCheckedRightButton";
  205.                 "kOtherRightButton";
  206.                 "kEnabledOnButton";
  207.                 "kDisabledOnButton";
  208.                 "kCheckedOnButton";
  209.                 "kOtherOnButton";
  210.                 "kEnabledOffButton";
  211.                 "kDisabledOffButton";
  212.                 "kCheckedOffButton";
  213.                 "kOtherOffButton";
  214.                 "kEnabledOnOffTitle";
  215.                 "kDisabledOnOffTitle";
  216.                 "kCheckedOnOffTitle";
  217.                 "kOtherOnOffTitle";
  218.           }
  219.         };
  220.         
  221.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  222. */
  223.  
  224. resource 'STR#' (-5694, sysheap, purgeable) {
  225.   {        
  226.   
  227.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  228.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  229.         "";    // message for the control that is Checked (ie CtrlValue>0)
  230.         "";    // message for the control that is Other (ie CtrlValue>1)
  231.         "";    // kEnabledRightButton
  232.         "";    // kDisabledRightButton
  233.         "";    // kCheckedRightButton
  234.         "";    // kOtherRightButton
  235.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  236.         "";    // kDisabledOnButton
  237.         "";    // kCheckedOnButton 
  238.         "";    // kOtherOnButton
  239.         "";    // kEnabledOffButton
  240.         "";    // kDisabledOffButton
  241.         "";    // kCheckedOffButton
  242.         "";    // kOtherOffButton
  243.         "";    // kEnabledOnOffTitle
  244.         "";    // kDisabledOnOffTitle
  245.         "";    // kCheckedOnOffTitle
  246.         "";    // kOtherOnOffTitle
  247.   }
  248. };
  249.  
  250.